<!doctype html>
<html lang="en">

<head>
    <title>泽兰抄-词条查询</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">


    <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,700&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="/static/fonts/icomoon/style.css">

    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/jquery.fancybox.min.css">
    <link rel="stylesheet" href="/static/css/owl.carousel.min.css">
    <link rel="stylesheet" href="/static/css/owl.theme.default.min.css">
    <link rel="stylesheet" href="/static/fonts/flaticon/font/flaticon.css">
    <link rel="stylesheet" href="/static/css/aos.css">

    <!-- MAIN CSS -->
    <link rel="stylesheet" href="/static/css/style.css">

    <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
    {#    图谱core js#}

</head>

<body data-spy="scroll" data-target=".site-navbar-target" data-offset="300">


<div class="site-wrap" id="home-section">

    <div class="site-mobile-menu site-navbar-target">
        <div class="site-mobile-menu-header">
            <div class="site-mobile-menu-close mt-3">
                <span class="icon-close2 js-menu-toggle"></span>
            </div>
        </div>
        <div class="site-mobile-menu-body"></div>
    </div>


    <header class="site-navbar js-sticky-header site-navbar-target" role="banner">

        <div class="container">
            <div class="row align-items-center position-relative">


                <div class="site-logo">
                    <a href="/index" class="text-black"><span class="text-primary">泽兰抄</span></a>
                </div>

                <div class="col-12">
                    <nav class="site-navigation text-right ml-auto " role="navigation">

                        {#                        导航栏右侧#}
                        <ul class="site-menu main-menu js-clone-nav ml-auto d-none d-lg-block">
                            {% ifequal 0 session.status %}
                                <li><a href="/login" class="nav-link">注册/登录</a></li>
                            {% endifequal %}
                            {% ifequal 1 session.status %}
                                <li><a class="nav-link">欢迎！{{ session.username }}</a></li>
                                <li><a href="/logout" class="nav-link">退出登录</a></li>

                            {% endifequal %}
                            <li><a href="/index" class="nav-link">返回首页</a></li>

                        </ul>
                    </nav>

                </div>

                <div class="toggle-button d-inline-block d-lg-none"><a href="#"
                                                                       class="site-menu-toggle py-5 js-menu-toggle text-black"><span
                        class="icon-menu h3"></span></a></div>

            </div>
        </div>

    </header>

    <div class="site-section-cover overlay inner-page bg-light"
         style="background-image: url('/static/images/medicine3.jpg')" data-aos="fade">

        <div class="container">
            <div class="row align-items-center justify-content-center text-center">
                <div class="col-lg-10">

                    <div class="box-shadow-content">
                        <div class="block-heading-1">
                            <span class="d-block mb-3 text-white" data-aos="fade-up">除了你在百度能看到的文本知识，我们还有形象的知识图谱！</span>
                            <h1 class="mb-4" data-aos="fade-up" data-aos-delay="100">词条搜索</h1>
                        </div>


                    </div>
                </div>
            </div>
        </div>

    </div>


    <div class="site-section">
        <div class="container">
            <div class="row">
                <div class="col-md-9 blog-content">

                    <div align="center"><h1>{{ a1 }}<br>&nbsp;</h1></div>

                    {% ifnotequal neonum 0 %}
                        <div id="main" style="width:1000px;height:800px" class="col-12"></div>
                    {% else %}
                        <p style="font-size: 18px;color: #78261f">知识图谱中没有查询到相关数据</p>
                    {% endifnotequal %}
                    <script type="text/javascript">
                        var myChart = echarts.init(document.getElementById('main'));
                        var data = [];
                        var links = [];

                        var graph ={{ graph|safe }};
                        var name = graph[0]['n1']['name'];
                        console.log(name);
                        for (var i = 0; i < 30 && i < graph.length; ++i) {
                            node1 = {};
                            node2 = {};
                            link = {};
                            var name1 = graph[i]['n1']['name'];
                            var name2 = graph[i]['n2']['name'];
                            var name3 = graph[i]['rel']['name']
                            {#if (name2 == {{ a1 }}) {#}
                            {#    var t = name1;#}
                            {#    name1 = name2;#}
                            {#    name2 = t;#}

                            node1['name'] = name1;
                            node1['des'] = node1['name'];
                            node1['symbolSize'] = 50;
                            node1['category'] = 0;

                            node2['name'] = name2;
                            node2['des'] = node2['name'];
                            node2['symbolSize'] = 50;
                            node2['category'] = 1;

                            if (i == 0) data.push(node1);
                            data.push(node2);

                            link['source'] = name1;
                            link['target'] = name2;
                            link['name'] = name3;
                            link['des'] = 'linkdes' + i;
                            links.push(link);
                        }


                        var categories = [];
                        for (var i = 0; i < 2; i++) {
                            categories[i] = {
                                name: '类目' + i
                            };
                        }


                        option = {
                            // 图的标题
                            title: {
                                text: '知识图谱(可以使用鼠标滚轮缩放哦)'
                            },
                            // 提示框的配置
                            tooltip: {
                                formatter: function (x) {
                                    return x.data.des;
                                }
                            },
                            // 工具箱
                            toolbox: {
                                // 显示工具箱
                                show: true,
                                feature: {
                                    mark: {
                                        show: true
                                    },
                                    // 还原
                                    restore: {
                                        show: true
                                    },
                                    // 保存为图片
                                    saveAsImage: {
                                        show: true
                                    }
                                }
                            },
                            series: [{
                                type: 'graph', // 类型:关系图
                                layout: 'force', //图的布局，类型为力导图
                                symbolSize: 50, // 调整节点的大小
                                roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                edgeSymbol: ['circle', 'arrow'],
                                edgeSymbolSize: [2, 10],
                                edgeLabel: {
                                    normal: {
                                        textStyle: {
                                            fontSize: 20
                                        }
                                    }
                                },
                                force: {
                                    repulsion: 1200,
                                    edgeLength: [10, 30]
                                },
                                draggable: true,
                                lineStyle: {
                                    normal: {
                                        width: 2,
                                        color: '#4b565b',
                                    }
                                },
                                edgeLabel: {
                                    normal: {
                                        show: true,
                                        formatter: function (x) {
                                            return x.data.name;
                                        }
                                    }
                                },
                                label: {
                                    normal: {
                                        show: true,
                                        textStyle: {}
                                    }
                                },

                                // 数据
                                data: data,
                                links: links,
                                categories: categories,
                            }]
                        };
                        myChart.setOption(option);
                    </script>

                    {#                    <p style="font-size: 18px;color: #4d4d4d">此外，我们在关系数据库中为您查询到了如下数据：</p>#}
                    {#                    {% ifequal a1 '' %}#}
                    {#                        <p style="font-size: 18px;color: #4d4d4d">您输入的是空串，我们无法为您检索想要的数据</p>#}
                    {#                    {% else %}#}
                    {#                        <p style="font-size: 18px;color: #4d4d4d">我们一共搜索到了{{ size }}条结果，分别如下：<br>&nbsp;</p>#}
                    {#                    {% endifequal %}#}
                    {##}
                    {##}
                    {#                    {% for a in ans %}#}
                    {#                        <div><h2>词条id{{ a.id }}</h2></div>#}
                    {#                        <div class="row">#}
                    {#                            <div class="col-lg-6">#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">处方用名</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.name 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.name }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">来源</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.source 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.source }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">炮制方法</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.paozhi 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.paozhi }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">成品性状</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.xingzhuang 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.xingzhuang }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {##}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">性味归经</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.xwgj 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.xwgj }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {##}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">功能主治</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.gnzz 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.gnzz }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {##}
                    {#                            </div>#}
                    {##}
                    {#                            <div class="col-lg-6">#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">知识图谱</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        当前无数据#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">炮制作用</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.pzzy 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.pzzy }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">用法与用量</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.yfyl 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.yfyl }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">贮存</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.zc 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.zc }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">使用注意</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.syzy 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.syzy }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                                <div class="card shadow mb-4">#}
                    {#                                    <div class="card-header py-3">#}
                    {#                                        <h6 class="m-0 font-weight-bold text-primary">参考资料</h6>#}
                    {#                                    </div>#}
                    {#                                    <div class="card-body">#}
                    {#                                        {% ifequal a.ckzl 'NAN' %}#}
                    {#                                            当前无数据#}
                    {#                                        {% else %}#}
                    {#                                            {{ a.ckzl }}#}
                    {#                                        {% endifequal %}#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                            </div>#}
                    {##}
                    {#                        </div>#}
                    {##}
                    {##}
                    {#                    {% endfor %}#}

                </div>
                <div class="col-md-3 sidebar">

                    <div class="sidebar-box">
                        <div class="categories">
                            <h3>功能跳转</h3>
                            <li><a href="/index">→图谱检索</a></li>
                            <li><a href="/qs">→智能问答</a></li>
                            <li><a href="#">→为您推荐</a></li>
                            <li><a href="/passageindex">→健康百科</a></li>
                            {#                            <li><a href="#">→文献查阅</a></li>#}
                            {#                            <li><a href="#">→疾病自诊</a></li>#}
                            {#                            <li><a href="#">→热门问答</a></li>#}
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>


    {#底部黑块#}
    <footer class="site-footer">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <div class="row">
                        <div class="col-md-7">
                            <h2 class="footer-heading mb-4">关于我们</h2>
                            <p>
                                我们是来自北京林业大学的开发团队！团队成员有曹泽昊，张谦，张家缘。希望我们的“泽兰抄”可以给您带来帮助。如有需要，可以通过上边的“联系我们”或者直接向2561360151@qq.com给我们发送邮件哦！</p>
                        </div>
                        {#                        <div class="col-md-4 ml-auto">#}
                        {#                            <h2 class="footer-heading mb-4">友情链接</h2>#}
                        {#                            <ul class="list-unstyled">#}
                        {#                                <li><a href="#">寻医问药网站</a></li>#}
                        {#                                <li><a href="#">网站A1</a></li>#}
                        {#                                <li><a href="#">网站A2</a></li>#}
                        {#                                <li><a href="#">网站A3</a></li>#}
                        {#                                <li><a href="#">网站A4</a></li>#}
                        {#                            </ul>#}
                        {#                        </div>#}

                    </div>
                </div>
                <div class="col-md-4 ml-auto">

                    <form action="#" method="post" class="footer-suscribe-form">
                        <div class="mb-5">
                            <h2 class="footer-heading mb-4">订阅我们的更新！</h2>

                            <div class="input-group mb-3">
                                <input type="text" class="form-control border-secondary text-white bg-transparent"
                                       placeholder="输入电子邮箱..." aria-label="Enter Email"
                                       aria-describedby="button-addon2">
                                <div class="input-group-append">
                                    <button class="btn btn-primary text-white" type="button" id="button-addon2">
                                        订阅
                                    </button>
                                </div>
                            </div>
                        </div>


                        {#                        <h2 class="footer-heading mb-4">Follow Us</h2>#}
                        {#                        <a href="#about-section" class="smoothscroll pl-0 pr-3"><span class="icon-facebook"></span></a>#}
                        {#                        <a href="#" class="pl-3 pr-3"><span class="icon-twitter"></span></a>#}
                        {#                        <a href="#" class="pl-3 pr-3"><span class="icon-instagram"></span></a>#}
                        {#                        <a href="#" class="pl-3 pr-3"><span class="icon-linkedin"></span></a>#}
                    </form>
                </div>
            </div>
            <div class="row pt-5 mt-5 text-center">
                <div class="col-md-12">
                    <div class="border-top pt-5">
                        <p>
                            <!-- Link back to cssmoban can't be removed. Template is licensed under CC BY 3.0. -->
                            Copyright &copy; 2021/5/4 BFU
                        </p>
                    </div>
                </div>

            </div>
        </div>
    </footer>

</div>

<script src="/static/js/jquery-3.3.1.min.js"></script>
<script src="/static/js/popper.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/owl.carousel.min.js"></script>
<script src="/static/js/jquery.sticky.js"></script>
<script src="/static/js/jquery.waypoints.min.js"></script>
<script src="/static/js/jquery.animateNumber.min.js"></script>
<script src="/static/js/jquery.fancybox.min.js"></script>
<script src="/static/js/jquery.easing.1.3.js"></script>
<script src="/static/js/aos.js"></script>

<script src="/static/js/main.js"></script>


</body>

</html>
